package com.ganlebao.study.springcloudribbon.basic;

import com.ganlebao.study.springcloudfeignclient.basic.dto.User;
import com.ganlebao.study.springcloudribbon.basic.acl.EchoServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 */
@RestController
@RequestMapping("ribbon/")
public class ServerController {

    @Autowired
    private EchoServer echoServer;

    /**
     * 简单测试轮询
     *
     * @return
     */
    @RequestMapping("echo")
    public String echoUser(String v) {
        return echoServer.echo(v);
    }

    /**
     * 带超时的测试轮询
     *
     * @return
     */
    @RequestMapping("echo-timeout")
    public String echoUserWithTimeOut(String v) {
        return echoServer.echoWithTimeout(v);
    }
}
